home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games 1996 December / Amiga Games 1996 #12.iso / userbox / publicdomain / arcdir / install arcdir < prev    next >
Text File  |  1996-07-19  |  8KB  |  270 lines

  1. ; $VER: Install ArcDir 1.0 (19.7.96)
  2. ; Script to install ArcDir.dopus5 1.0.
  3. ; Written by Edmund Vermeulen (edmundv@grafix.xs4all.nl).
  4.  
  5. (set @default-dest "")
  6.  
  7. (set #proprender (if (>= @installer-version 42) "p" ""))
  8.  
  9.  
  10. ;=============================================================================
  11. ; check if Directory Opus 5 has been installed
  12.  
  13. (if
  14.    (= (exists "DOpus5:DirectoryOpus" (noreq)) 0)
  15.    (abort "Directory Opus 5 must be installed first.")
  16. )
  17.  
  18.  
  19. ;=============================================================================
  20. ; uninstall
  21.  
  22. (if
  23.    (=
  24.       (getversion "ARexx/ArcDir.dopus5")
  25.       (getversion "DOpus5:ARexx/ArcDir.dopus5")
  26.    )
  27.    (if
  28.       (=
  29.          (askchoice
  30.             (prompt "ArcDir.dopus5 is already installed.")
  31.             (help @askchoice-help)
  32.             (choices (cat #proprender "Uninstall it.") "Install it again.")
  33.          )
  34.          0
  35.       )
  36.       (
  37.          (delete "DOpus5:ARexx/ArcDir.dopus5")
  38.          (delete "DOpus5:ARexx/NewArc.dopus5")
  39.          (delete "DOpus5:C/ArcDirList")
  40.          (delete "DOpus5:C/Move")
  41.          (delete "Locale:Catalogs/nederlands/ArcDir.catalog")
  42.          (delete "Locale:Catalogs/deutsch/ArcDir.catalog")
  43.          (delete "Locale:Catalogs/français/ArcDir.catalog")
  44.          (delete "Locale:Catalogs/norsk/ArcDir.catalog")
  45.          (delete "DOpus5:Filetypes/LHA archive")
  46.          (delete "DOpus5:Filetypes/LZX archive")
  47.  
  48.          (set #storedir
  49.             (if
  50.                (= (exists "DOpus5:Storage/Filetypes") 2)
  51.                "DOpus5:Storage/Filetypes/"
  52.                "DOpus5:Storage/"
  53.             )
  54.          )
  55.          (set #n 0)
  56.          (while
  57.             (set #arctype (select #n "LHA" "LZX" ""))
  58.             (
  59.                (copyfiles
  60.                   (source (cat #storedir #arctype " archive"))
  61.                   (dest "DOpus5:Filetypes")
  62.                )
  63.                (set #n (+ #n 1))
  64.             )
  65.          )
  66.  
  67.          (exit "ArcDir has been uninstalled.")
  68.       )
  69.    )
  70. )
  71.  
  72.  
  73. ;=============================================================================
  74. ; delete old stuff
  75.  
  76. (if
  77.    (= (getversion "DOpus5:ARexx/LhADir.dopus5") 65536)
  78.    (message "Version 1.0 of LhADir.dopus5 detected!\n\n"
  79.             "Please note that ArcDir.dopus5 doesn't need any alterations "
  80.             "to the toolbar or any other buttons in Opus whatsoever.\n\n"
  81.             "You should remove all references to LhADir.dopus5. Copying "
  82.             "the default toolbar over your old toolbar will usually "
  83.             "accomplish this."
  84.    )
  85. )
  86.  
  87. (if
  88.    (= (exists "DOpus5:ARexx/LhADir.dopus5") 1)
  89.    (if
  90.       (askbool
  91.          (prompt "LhADir.dopus5 detected.\n\n"
  92.                  "LhADir has been superseded by ArcDir and is not needed "
  93.                  "any more. Is it okay to delete it?"
  94.          )
  95.          (help "Select 'Yes' to delete LhADir.dopus5 and related files "
  96.                "from your system or 'No' to leave them alone."
  97.          )
  98.       )
  99.       (
  100.          (delete "DOpus5:ARexx/LhADir.dopus5")
  101.          (delete "DOpus5:ARexx/LhADir-handler")
  102.          (delete "DOpus5:ARexx/NewLhA.dopus5")
  103.          (delete "DOpus5:C/LhADirList")
  104.          (delete "Locale:Catalogs/nederlands/LhADir.catalog")
  105.          (delete "Locale:Catalogs/deutsch/LhADir.catalog")
  106.          (delete "Locale:Catalogs/français/LhADir.catalog")
  107.          (delete "Locale:Catalogs/norsk/LhADir.catalog")
  108.          (delete "DOpus5:Buttons/LhADir Buttons")
  109.          (delete "DOpus5:Buttons/toolbar_LhADir")
  110.       )
  111.    )
  112. )
  113.  
  114.  
  115. ;=============================================================================
  116. ; ask questions first, copy files later
  117.  
  118. (set
  119.    #storeold
  120.    (if
  121.       (= @user-level 2)
  122.       (askbool
  123.          (prompt "Your current filetypes for LHA and LZX will be overwritten. "
  124.                  "Would you like to keep a safe copy of them in the "
  125.                  "'DOpus5:Storage' drawer?\n\n"
  126.                  "In case of an uninstallation these files will be reinstalled."
  127.          )
  128.          (help "Select 'Yes' to copy the files 'LHA archive' and 'LZX archive' "
  129.                "from the 'DOpus5:Filetypes' drawer to the 'DOpus5:Storage' "
  130.                "drawer. If you select 'No', the current (default) filetypes for "
  131.                "LHA and LZX in the Storage drawer will be kept.\n\n"
  132.                "When doing an uninstallation, these filetypes will be "
  133.                "reinstalled from the Storage drawer to the Filetypes drawer. "
  134.                "You can accomplish an uninstallation by running this "
  135.                "installation script again."
  136.         )
  137.       )
  138.    )
  139. )
  140.  
  141. (set
  142.    #how
  143.    (+
  144.       (askchoice
  145.          (prompt "How would you like an archive to be listed when it "
  146.                  "is double-clicked?"
  147.          )
  148.          (help @askchoice-help)
  149.          (choices
  150.             (cat #proprender "In a new lister (Browse).")
  151.             "In the same lister (GetDir)."
  152.          )
  153.       )
  154.       (* 2
  155.          (askchoice
  156.             (prompt "What do you want to happen when you drag and drop "
  157.                     "an archive in another lister?"
  158.             )
  159.             (help @askchoice-help)
  160.             (choices
  161.                (cat #proprender "Extract it (with LhA/LZX).")
  162.                "List it (with ArcDir)."
  163.             )
  164.          )
  165.       )
  166.    )     
  167. )
  168.  
  169. (set
  170.    #language
  171.    (if
  172.       (= (exists "ENV:Language") 1)
  173.       (getenv "Language")
  174.       ""
  175.    )
  176. )
  177. (set #catalogs
  178.    (askoptions
  179.       (prompt "Which language catalog(s) do you want to install?")
  180.       (help @askoptions-help)
  181.       (choices (cat #proprender "Nederlands") "Deutsch" "Français" "Norsk")
  182.       (default 
  183.          (+
  184.             (= #language "nederlands")
  185.             (* 2 (= #language "deutsch"))
  186.             (* 4 (= #language "français"))
  187.             (* 8 (= #language "norsk"))
  188.          )
  189.       )
  190.    )
  191. )
  192.  
  193.  
  194. ;=============================================================================
  195. ; copy the files
  196.  
  197. (set @default-dest "DOpus5:")
  198.  
  199. (copyfiles
  200.    (source "ARexx")
  201.    (dest "DOpus5:ARexx")
  202.    (pattern "#?")
  203.    (files)
  204. )
  205. (copyfiles
  206.    (source "C")
  207.    (dest "DOpus5:C")
  208.    (pattern "#?")
  209.    (files)
  210. )
  211.  
  212. (set #storedir
  213.    (if
  214.       (= (exists "DOpus5:Storage/Filetypes") 2)
  215.       "DOpus5:Storage/Filetypes"
  216.       "DOpus5:Storage"
  217.    )
  218. )
  219. (set #n 0)
  220. (while
  221.    (set #arctype (select #n "LHA" "LZX" ""))
  222.    (
  223.       (if
  224.          #storeold
  225.          (copyfiles
  226.             (source (cat "DOpus5:Filetypes/" #arctype " archive"))
  227.             (dest #storedir)
  228.          )
  229.       )
  230.       (copyfiles
  231.          (source
  232.             (select
  233.                #how
  234.                (cat "Filetypes/" #arctype " archive")
  235.                (cat "Storage/Filetypes/" #arctype " archive_GetDir")
  236.                (cat "Storage/Filetypes/" #arctype " archive_Browse&DnD")
  237.                (cat "Storage/Filetypes/" #arctype " archive_GetDir&DnD")
  238.             )
  239.          )
  240.          (dest "DOpus5:Filetypes")
  241.          (newname (cat #arctype " archive"))
  242.       )
  243.       (set #n (+ #n 1))
  244.    )
  245. )
  246.  
  247. (set #n 0)
  248. (while
  249.    (set #thiscat (select #n "nederlands" "deutsch" "français" "norsk" ""))
  250.    (
  251.       (if
  252.          (in #catalogs #n)
  253.          (copyfiles
  254.             (source (cat "Locale/Catalogs/" #thiscat "/ArcDir.catalog"))
  255.             (dest (cat "LOCALE:Catalogs/" #thiscat))
  256.          )
  257.       )
  258.       (set #n (+ #n 1))
  259.    )
  260. )
  261.  
  262.  
  263. ;=============================================================================
  264. ; exit message
  265.  
  266. (exit "To be able to use ArcDir.dopus5, ARexx needs to be activated "
  267.       "by running the RexxMast program from the System drawer.\n\n"
  268.       "You may uninstall ArcDir by running this installation script again."
  269. )
  270.